/* render cells */
area.x = 0;
area.y = 0;
- gtk_widget_get_content_size (widget, &area.width, &area.height);
+ area.width = gtk_widget_get_width (widget);
+ area.height = gtk_widget_get_height (widget);
/* set cell data (if available) */
if (cellview->priv->displayed_row)
if (priv->wrap_width == 0)
{
- int width, height, min_width, nat_width;
+ int width, min_width, nat_width;
- gtk_widget_get_content_size (GTK_WIDGET (combo_box), &width, &height);
+ width = gtk_widget_get_width (GTK_WIDGET (combo_box));
gtk_widget_set_size_request (priv->popup_widget, -1, -1);
gtk_widget_measure (priv->popup_widget, GTK_ORIENTATION_HORIZONTAL, -1,
&min_width, &nat_width, NULL, NULL);
if (!priv->draw_func)
return;
- gtk_widget_get_content_size (widget, &width, &height);
+ width = gtk_widget_get_width (widget);
+ height = gtk_widget_get_height (widget);
+
cr = gtk_snapshot_append_cairo (snapshot,
&GRAPHENE_RECT_INIT (
GTK_WIDGET_CLASS (gtk_flow_box_parent_class)->snapshot (widget, snapshot);
- gtk_widget_get_content_size (widget, &width, &height);
x = 0;
y = 0;
+ width = gtk_widget_get_width (widget);
+ height = gtk_widget_get_height (widget);
if (priv->rubberband_first && priv->rubberband_last)
{
context = gtk_widget_get_style_context (widget);
- gtk_widget_get_content_size (widget, &width, &height);
+ width = gtk_widget_get_width (widget);
+ height = gtk_widget_get_height (widget);
gtk_snapshot_push_clip (snapshot,
&GRAPHENE_RECT_INIT (
0, 0,
if (icon_view->priv->doing_rubberband)
{
- int width, height;
+ int height;
gtk_icon_view_update_rubberband (icon_view);
abs_y = icon_view->priv->mouse_y - icon_view->priv->height *
(gtk_adjustment_get_upper (icon_view->priv->vadjustment) -
gtk_adjustment_get_lower (icon_view->priv->vadjustment)));
- gtk_widget_get_content_size (widget, &width, &height);
+ height = gtk_widget_get_height (widget);
+
if (abs_y < 0 || abs_y > height)
{
static void
gtk_icon_view_set_hadjustment_values (GtkIconView *icon_view)
{
- int width, height;
+ int width;
GtkAdjustment *adj = icon_view->priv->hadjustment;
gdouble old_page_size;
gdouble old_upper;
gdouble new_value;
gdouble new_upper;
- gtk_widget_get_content_size (GTK_WIDGET (icon_view), &width, &height);
+ width = gtk_widget_get_width (GTK_WIDGET (icon_view));
old_value = gtk_adjustment_get_value (adj);
old_upper = gtk_adjustment_get_upper (adj);
static void
gtk_icon_view_set_vadjustment_values (GtkIconView *icon_view)
{
- int width, height;
+ int height;
GtkAdjustment *adj = icon_view->priv->vadjustment;
- gtk_widget_get_content_size (GTK_WIDGET (icon_view), &width, &height);
+ height = gtk_widget_get_height (GTK_WIDGET (icon_view));
gtk_adjustment_configure (adj,
gtk_adjustment_get_value (adj),
rtl = gtk_widget_get_direction (GTK_WIDGET (icon_view)) == GTK_TEXT_DIR_RTL;
n_items = gtk_icon_view_get_n_items (icon_view);
- gtk_widget_get_content_size (widget, &width, &height);
+ width = gtk_widget_get_width (widget);
+ height = gtk_widget_get_height (widget);
gtk_icon_view_compute_n_items_for_size (icon_view,
GTK_ORIENTATION_HORIZONTAL,
x =0;
y =0;
- gtk_widget_get_content_size (widget, &width, &height);
+ width = gtk_widget_get_width (widget);
+ height = gtk_widget_get_height (widget);
offset = y + item_area.y - row_align * (height - item_area.height);
item_area.width = item->cell_area.width + priv->item_padding * 2;
item_area.height = item->cell_area.height + priv->item_padding * 2;
- gtk_widget_get_content_size (widget, &widget_width, &widget_height);
+ widget_width = gtk_widget_get_width (widget);
+ widget_height = gtk_widget_get_height (widget);
hadj = icon_view->priv->hadjustment;
vadj = icon_view->priv->vadjustment;
px = icon_view->priv->event_last_x;
py = icon_view->priv->event_last_y;
- gtk_widget_get_content_size (GTK_WIDGET (icon_view), &width, &height);
+ width = gtk_widget_get_width (GTK_WIDGET (icon_view));
+ height = gtk_widget_get_height (GTK_WIDGET (icon_view));
/* see if we are near the edge. */
voffset = py - 2 * SCROLL_EDGE_SIZE;
get_bin_window_x (GtkStack *stack)
{
GtkStackPrivate *priv = gtk_stack_get_instance_private (stack);
- int width, height;
+ int width;
int x = 0;
- gtk_widget_get_content_size (GTK_WIDGET (stack), &width, &height);
+ width = gtk_widget_get_width (GTK_WIDGET (stack));
if (gtk_progress_tracker_get_state (&priv->tracker) != GTK_PROGRESS_STATE_AFTER)
{
get_bin_window_y (GtkStack *stack)
{
GtkStackPrivate *priv = gtk_stack_get_instance_private (stack);
- int width, height;
+ int height;
int y = 0;
- gtk_widget_get_content_size (GTK_WIDGET (stack), &width, &height);
+ height = gtk_widget_get_height (GTK_WIDGET (stack));
if (gtk_progress_tracker_get_state (&priv->tracker) != GTK_PROGRESS_STATE_AFTER)
{
gint x, y, width, height, pos_x, pos_y;
- gtk_widget_get_content_size (widget, &widget_width, &widget_height);
x = y = 0;
- width = widget_width;
- height = widget_height;
+ width = widget_width = gtk_widget_get_width (widget);
+ height = widget_height = gtk_widget_get_height (widget);
pos_x = pos_y = 0;
int x, y;
int width, height;
- gtk_widget_get_content_size (widget, &width, &height);
+ width = gtk_widget_get_width (widget);
+ height = gtk_widget_get_height (widget);
x = get_bin_window_x (stack);
y = get_bin_window_y (stack);
{
if (gtk_progress_tracker_get_state (&priv->tracker) != GTK_PROGRESS_STATE_AFTER)
{
- int width, height;
-
if (priv->last_visible_node == NULL &&
priv->last_visible_child != NULL)
{
priv->last_visible_node = gtk_snapshot_finish (&last_visible_snapshot);
}
- gtk_widget_get_content_size (widget, &width, &height);
gtk_snapshot_push_clip (snapshot,
&GRAPHENE_RECT_INIT(
0, 0,
- width, height
+ gtk_widget_get_width (widget),
+ gtk_widget_get_height (widget)
),
"StackAnimationClip");
gtk_tool_palette_snapshot (GtkWidget *widget,
GtkSnapshot *snapshot)
{
- int width, height;
-
- gtk_widget_get_content_size (widget, &width, &height);
-
gtk_snapshot_push_clip (snapshot,
- &GRAPHENE_RECT_INIT(0, 0, width, height), "ToolPalette Clip");
+ &GRAPHENE_RECT_INIT(
+ 0, 0,
+ gtk_widget_get_width (widget),
+ gtk_widget_get_height (widget)
+ ), "ToolPalette Clip");
GTK_WIDGET_CLASS (gtk_tool_palette_parent_class)->snapshot (widget, snapshot);
if (gtk_widget_has_visible_focus (widget))
{
- int width, height;
-
- gtk_widget_get_content_size (widget, &width, &height);
- gtk_snapshot_render_focus (snapshot, context, 0, 0, width, height);
+ gtk_snapshot_render_focus (snapshot, context,
+ 0, 0,
+ gtk_widget_get_width (widget),
+ gtk_widget_get_height (widget));
}
}
return;
}
- gtk_widget_get_content_size (GTK_WIDGET (tree_view), &bin_window_width, &bin_window_height);
+ bin_window_width = gtk_widget_get_width (GTK_WIDGET (tree_view));
+ bin_window_height = gtk_widget_get_height(GTK_WIDGET (tree_view));
clip = (GdkRectangle) { 0, 0, bin_window_width, bin_window_height };
new_y = TREE_WINDOW_Y_TO_RBTREE_Y (tree_view, clip.y);
gint x = 1, y = 1;
cairo_surface_t *surface;
gint bin_window_width;
- gint bin_window_height;
gboolean is_separator = FALSE;
gboolean rtl;
cairo_t *cr;
background_area.y = y;
background_area.height = gtk_tree_view_get_row_height (tree_view, node);
- gtk_widget_get_content_size (GTK_WIDGET (tree_view), &bin_window_width, &bin_window_height);
+ bin_window_width = gtk_widget_get_width (GTK_WIDGET (tree_view));
surface = gdk_window_create_similar_surface (gtk_widget_get_window (GTK_WIDGET (tree_view)),
CAIRO_CONTENT_COLOR,
allocation->height = priv->allocation.height -margin.top - margin.bottom;
}
-void
-gtk_widget_get_content_size (GtkWidget *widget,
- int *width,
- int *height)
-{
- GtkWidgetPrivate *priv = gtk_widget_get_instance_private (widget);
- GtkBorder margin, border, padding;
- GtkCssStyle *style;
-
- style = gtk_css_node_get_style (priv->cssnode);
- get_box_margin (style, &margin);
- get_box_border (style, &border);
- get_box_padding (style, &padding);
-
- *width = priv->allocation.width;
- *height = priv->allocation.height;
-
- *width -= margin.left + border.left + padding.left +
- margin.right + border.right + padding.right;
- *height -= margin.top + border.top + padding.top +
- margin.bottom + border.bottom + padding.bottom;
-}
-
/**
* gtk_widget_get_allocated_width:
* @widget: the widget to query
GtkAllocation *allocation);
void gtk_widget_get_own_allocation (GtkWidget *widget,
GtkAllocation *allocation);
-void gtk_widget_get_content_size (GtkWidget *widget,
- int *width,
- int *height);
void gtk_widget_get_window_allocation (GtkWidget *widget,
GtkAllocation *allocation);
context = gtk_widget_get_style_context (widget);
get_shadow_width (GTK_WINDOW (widget), &window_border);
- gtk_widget_get_content_size (widget, &width, &height);
+ width = gtk_widget_get_width (widget);
+ height = gtk_widget_get_height (widget);
if (priv->client_decorated &&
priv->decorated &&